package com.cswangdao.mapper;

import com.cswangdao.domain.dto.GoodsPageDTO;
import com.cswangdao.domain.model.MarketGoods;
import com.cswangdao.domain.po.Goods;
import com.cswangdao.domain.vo.GoodsOfCategoryVo;
import com.cswangdao.domain.vo.TopicGoodsVo;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MarketGoodsMapper {

    /**
     * @description: 分页查询商品信息
     * @param: goodsPageDTO
     * @return: Page<Goods>
     */
    Page<Goods> pageQueryInfo(GoodsPageDTO goodsPageDTO);

    /**
     * @description: 新增商品
     * @param: goods
     * @return: void
     */
    void insert(Goods goods);

    @Delete("delete from market_goods where id = #{id} ")
    void deleteById(@Param("id") Integer id);

    MarketGoods getById(@Param("goodsId") int goodsId);

    void updateById(Goods goods);

    List<TopicGoodsVo> queryByIds(List<Integer> list);


    List<MarketGoods> getHotOrNewGoods(@Param("isHotOrNew") String isHotOrNew, @Param("status") int status, @Param("limit") Integer limit);


    Page<MarketGoods> getGoodsByBrandId(@Param("brandId") Integer brandId);

    List<MarketGoods> getByIds(List<Integer> goodsIds);
}